<?php
include("../../inc/conn.inc");
include("../islogin2.php");
include("../../job/inc/fun.php");
$url="hr.php";
$thepage=$_GET['page']?$_GET['page']:1;
$maxpage=15;
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>会员中心-三帝贸易网</title>
<link href="../css/css.css" rel="stylesheet" type="text/css" />
</head>
<script type="text/javascript" src="../js/left.js" charset="gb2312"></script>
<script type="text/javascript" src="/js/city.js" charset="gb2312"></script>

<body>
<div id="mian">
<?php include("../inc/top.php");?>
<div class="top1"><span>您当前位置：<a href="../index.php" class="dh">会员助手</a> &gt;&gt; 招聘管理 &gt;&gt; 人才库</span></div>
<div class="left">
<?php include("../inc/left.php");?>
</div>
<div class="right">
<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
   <TR>
     <TD height="40" bgcolor="#EFF6FF" style="font-size:18px;font-weight:bold;padding-left:8px;">人才库</TD>
   </TR>
</TABLE>
<br>
<TABLE width="100%" border="0" cellpadding="0" cellSpacing="1" bgcolor="#C1DCF5">
    <form method="get" action="" name="form1">
          <TR>
            <td width="19%" height="25" align="center" bgcolor="#EFF6FF">人才职位</td>
            <TD width="81%" bgcolor="#F9F9F9" style="padding-left:4px;">
			<select name="job_class" id="job_class" style="width:190px;">
                              <option value="">选择、修改</option>
							  <?php
							     $rs=@mysql_query("select id,j_c_name from job_class  where j_c_id=0");
								 while($row=@mysql_fetch_array($rs)){
							  ?><option value="<?=$row['id']?>"><?=$row[j_c_name]?></option>
							  <?php }?>
                          </select></TD>
          </TR>
          <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">人才行业</td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><select name="job_hy" id="job_hy" style="width:190px;">
                            <option value="">选择、修改</option>
							  <?php
							     $rs=@mysql_query("select id,job_hy_name from job_hy where job_hy_id=0");
								 while($row=@mysql_fetch_array($rs)){
							  ?><option value="<?=$row['id']?>@<?=$row[job_hy_name]?>"><?=$row[job_hy_name]?></option>
							  <?php }?>
                          </select></TD>
          </TR>
          <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">人才城市</td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><select  name="c_provinces4" id="c_provinces4" onChange="changecity4(document.form1.c_provinces4.options[document.form1.c_provinces4.selectedIndex].value)">
            <option value="">省份</option>
          <?php
          $result = mysql_query("select * from city where city_id=0");    
          while($res = mysql_fetch_array($result)){    
          ?>    
          <option value="<?=$res['id']?>"><?=$res['city_name']?></option> 
          <?php }?>   
       </select>
       <select name="c_city4" id="c_city4" onChange="changecity5(document.form1.c_city4.options[document.form1.c_city4.selectedIndex].value)">
            <option value="">城市</option>
       </select>
	   <select name="c_diqu4" id="c_diqu4">
            <option value="">地区</option>
       </select></TD>
          </TR>
          <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">工作经验</td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><select name="job_exp" id="job_exp">
              <option value="" selected="selected">不限</option>
              <option value="2">1年以下</option>
              <option value="3">1-2年</option>
              <option value="4">3-5年</option>
              <option value="5">6-7年</option>
              <option value="6">8-10年</option>
              <option value="7">10年以上</option>
            </select></TD>
          </TR>
		  <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">更新时间</td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><select name="job_effe" id="job_effe">
            <OPTION value="">不限制</OPTION>
                <OPTION value="2">3天</OPTION>
                <OPTION value="3">5天</OPTION>
				<OPTION value="4">7天</OPTION>
				<OPTION value="5">半个月</OPTION>
				<OPTION value="6">一个月</OPTION>
				<OPTION value="7">三个月</OPTION>
				<OPTION value="8">半年</OPTION>
				<OPTION value="9">一年</OPTION>
			</SELECT></TD>
          </TR>
		  <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">学历要求</td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><select name="job_edu" id="job_edu">
              <option value="" selected="selected">不限</option>
              <option value="2">高中及高中以下</option>
              <option value="3">技校</option>
              <option value="4">中专</option>
              <option value="5">大专</option>
              <option value="6">本科</option>
              <option value="7">硕士</option>
              <option value="8">博士及博士以上</option>
            </select></TD>
          </TR>
          <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">性别要求</td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><select name="job_sex" id="job_sex">
            <OPTION value="">不限</OPTION>
                <OPTION value="2">男</OPTION>
                <OPTION value="3">女</OPTION>
			</SELECT></TD>
        </TR>
          <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">&nbsp;</td>
            <TD height="40" bgcolor="#F9F9F9" style="padding-left:4px;"><input type="submit" value=" 搜 索 "></TD>
          </TR>
 </form>                
</TABLE>
<table width="100%" cellspacing="1" bgcolor="#C1DCF5">
        <tr>
          <td width="5%" height="30" align="center" bgcolor="#EFF6FF">编号</td>
          <td width="14%" align="center" bgcolor="#EFF6FF">姓名</td>
          <td width="13%" align="center" bgcolor="#EFF6FF">性别</td>
          <td width="20%" align="center" bgcolor="#EFF6FF">学历</td>
          <td width="33%" align="center" bgcolor="#EFF6FF">期望职位</td>
          <td width="15%" align="center" bgcolor="#EFF6FF">更新时间</td>
        </tr>
<?php
if($_GET[job_class]){
$sqls.=" and (p_class regexp '".$_GET[job_class]."@' || p_class regexp '@".$_GET[job_class]."')";
}
if($_GET[job_class]){
$sqls.=" and (p_hy regexp '".$_GET[job_hy]."@' || p_hy regexp '@".$_GET[job_hy]."')";
}
if($_GET[c_provinces4]){
$sqls.=" and p_qw_pro_id='$_GET[c_provinces4]'";
}

if($_GET[c_city4]){
$sqls.=" and p_qw_city_id='$_GET[c_city4]'";
}

if($_GET[c_diqu4]){
$sqls.=" and p_qw_dq_id='$_GET[c_diqu4]'";
}



if($_GET[job_exp]){
$sqls.=" and p_exp='$_GET[job_exp]'";
}
if($_GET[job_effe]){
$b="-".$_GET[job_effe];
$dates=date("Y-m-d",strtotime("+".$b."day"));
$sqls=$sqls." and p_edittime >='$dates'";
}
if($_GET[job_edu]){
$sqls.=" and p_edu='$_GET[job_edu]'";
}
if($_GET[job_sex]){
$sqls.=" and p_sex='$_GET[job_sex]'";
}


$sql="select id,p_name,p_sex,p_edu,p_class,p_edittime from job_per where p_isopen='1' and p_step=1 ".$sqls." order by p_edittime desc limit ".($thepage-1)*$maxpage.",$maxpage";
$rs=mysql_query($sql);
$i=1;
while($row=mysql_fetch_array($rs)){
?>
        <tr style="line-height:22px;">
          <td height="22" align="center" bgcolor="#FFFFFF"><?=$i?></td>
          <td align="center" bgcolor="#FFFFFF"><a href="perinfo.php?id=<?=$row['id']?>" target="_blank"><?=$row[p_name]?></a></td>
          <td align="center" bgcolor="#FFFFFF"><?=job_sex($row[p_sex])?></td>
          <td align="center" bgcolor="#FFFFFF"><?=job_edu($row[p_edu])?></td>
          <td align="center" bgcolor="#FFFFFF">
		  <?php
		   $p_class=explode("@",$row[p_class]);
		   if($p_class[0]){
		     for($j=0;$j<count($p_class);$j++){
		       if($p_class[$j]){
			     $sql2.=" id='$p_class[$j]' ||";
			   }
		     }
			 $sql2=" (".substr($sql2,0,-2)." )";
			 $rs2=@mysql_query("select j_c_name from job_class where ".$sql2);
			
			 while($row2=@mysql_fetch_array($rs2)){echo $row2[j_c_name]."<br>";}
			 }
		  ?>
		  </td>
          <td align="center" bgcolor="#FFFFFF"><?=date("Y-m-d",strtotime($row[p_edittime]))?></td>
        </tr>
<?php
$i++;
}?>
<?php
$rs3=@mysql_query("select count(id) from job_per where p_isopen='1'".$sqls);
$totalrecord=@mysql_result($rs3,0);
@mysql_free_result($rs3);
$totalpage=ceil($totalrecord/$maxpage);
if($totalpage>0){
?>
        <tr>
          <td colspan="6" align="center" bgcolor="#FFFFFF" height="18"><script language="javascript">
<!--
function showPageLink(sUrl,iPage,iCount){
	var i;
	i=Math.max(1,iPage-1);
	document.write("<a href=\"" + sUrl + "1\">«</a> ");
	document.write("<a href=\"" + sUrl + i + "\">上一页</a> ");
	for(i=Math.max(1,iPage-8);i<iPage;i++){
		document.write("<a href=\""+sUrl + i + "\"><b>" + i + "</b></a> ");
	}
	document.write("<font color='#ff3333'><b>" + iPage + "</b></font> ");
	for(i=iPage+1;i<=Math.min(iCount,iPage+8);i++){
		document.write("<a href=\""+sUrl + i + "\"><b>" + i + "</b></a> ");
	}
	i=Math.min(iCount,iPage+1);
	if(iCount>iPage+8) document.write("<span style='font-size:8px'>···</span> ");
	document.write("<a href=\"" + sUrl + i + "\">下一页</a> ");
	document.write("<a href=\"" + sUrl + iCount + "\">»</a> ");
}
showPageLink("<?=$url?>?job_class=<?=$_GET[job_class]?>&job_class=<?=$_GET[job_class]?>&c_provinces4=<?=$_GET[c_provinces4]?>&c_city4=<?=$_GET[c_city4]?>&c_diqu4=<?=$_GET[c_diqu4]?>&job_exp=<?=$_GET[job_exp]?>&job_effe=<?=$_GET[job_effe]?>&job_edu=<?=$_GET[job_edu]?>&job_sex=<?=$_GET[job_sex]?>&page=",<?=$thepage?>,<?=$totalpage?>);
//-->
</script></td>
        </tr><?php }?>
    </table>
</div>
<div class="onl"></div>
<?php include("../inc/foot.php");?>
</div>
</body>
</html>
